/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edu.uniminuto.Validator;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

/**
 *
 * @author diegoalejandro
 */
@FacesValidator("com.edu.uniminuto.Validator.nombreValidator")
public class nombreValidator implements Validator{

    @Override
    public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
           
        String nombreUsuario="";
        
         if(!nombreUsuario.contains("@")) {
           
			FacesMessage msg = 
				new FacesMessage("E-mail validation failed.", 
						"Invalid E-mail format.");
			msg.setSeverity(FacesMessage.SEVERITY_ERROR);
			throw new ValidatorException(msg);
        }
    }
    
    
}
